#include "threadedBTree.h"
ThreadedBTree *initTree() {
    TreeNode *nodeA = createTreeNode('A');
    TreeNode *nodeB = createTreeNode('B');
    TreeNode *nodeC = createTreeNode('C');
    TreeNode *nodeD = createTreeNode('D');
    TreeNode *nodeE = createTreeNode('E');
    TreeNode *nodeF = createTreeNode('F');
    TreeNode *nodeG = createTreeNode('G');
    TreeNode *nodeH = createTreeNode('H');
    TreeNode *nodeK = createTreeNode('K');

    ThreadedBTree *tree = createThreadedBTree(nodeA);
    insertTBTNode(tree, nodeA, nodeB, nodeE);
    insertTBTNode(tree, nodeB, NULL, nodeC);
    insertTBTNode(tree, nodeE, NULL, nodeF);
    insertTBTNode(tree, nodeC, nodeD, NULL);
    insertTBTNode(tree, nodeF, nodeG, NULL);
    insertTBTNode(tree, nodeG, nodeH, nodeK);
    return tree;
}

void test01() {
    ThreadedBTree *tree = initTree();
    printf("node:%d\n",tree->count);
    inOrderThreadedTree(tree);
    printf("result:");
    inOrderTBTree(tree);
    printf("\n");
    releaseThreadBTree(tree);
}

int main() {
    test01();
    return 0;
}